package com.csx.micrometer.invoke.config;


import com.csx.micrometer.invoke.custom.DefaultTagsCustom;
import com.csx.micrometer.invoke.custom.TagsCustom;
import io.micrometer.core.instrument.MeterRegistry;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * @author cuisongxu
 * @date 2022/12/3 22:48
 */
@ConditionalOnClass({MeterRegistry.class})
@Configuration
@Import({
        ServletInboundMicrometerConfiguration.class,
        FeignOutboundMicrometerConfiguration.class,
        RestTemplateOutboundMicrometerConfiguration.class,
        LoadBalancerOutBoundConfiguration.class,
        WebFluxInboundMicrometerConfiguration.class
        })
@ConditionalOnProperty(value = "micrometer.invoke.enabled", havingValue = "true", matchIfMissing = true)
public class MicrometerInvokeAutoConfiguration {

        @Bean
        public TagsCustom defaultTagsCustom() {
                return new DefaultTagsCustom();
        }
}
